using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Windows.Data;
using System.Windows;
using System.Globalization;

namespace MyPublisher.Windows.Controls.Primitives
{

    [ValueConversion(typeof(bool), typeof(string))]
    public class Bool2StringContentConverter : IMultiValueConverter
    {
        private static Bool2StringContentConverter _instance;
        public static Bool2StringContentConverter Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new Bool2StringContentConverter();
                }

                return _instance;
            }
        }

        #region IMultiValueConverter Members

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (null == values || values.Length < 2 || null == values[0] || null == values[1])
            {
                return false;
            }
            return values[0].Equals(values[1].ToString());
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
